class Animal:
    def __init__(self, name):
        self.__name = name

    def get_name(self):
        return self.__name

    def set_name(self, name):
        self.__name = name

    def bark(self):
        print(f"{self.__name}在叫")


class Dog(Animal):
    def bark(self):
        print(f"{super().get_name()}在汪汪叫")


class Cat(Animal):
    def bark(self):
        print(f"{super().get_name()}在喵喵叫")


def bark(obj):
    obj.bark()


dog1 = Dog('狗')
print(dog1.get_name())
cat1 = Cat('猫')
print(cat1.get_name())
dog1.set_name('哈吉汪')
bark(dog1)
cat1.set_name('哈吉米')
bark(cat1)
